package serviceImpl;

import java.util.ArrayList;

import dao.BackMallDao;
import dao.CollegeDao;
import dao.MallDao;
import daoImpl.BackMallDaoImpl;
import daoImpl.CollegeDaoImpl;
import daoImpl.MallDaoImpl;
import pojo.Book;
import pojo.College;
import service.BackMallService;

public class BackMallServiceImpl implements BackMallService{

	@Override
	public ArrayList<Book> getBooks() {
		BackMallDao md = new BackMallDaoImpl();
		ArrayList<Book> bList = md.getBooks();
		return bList;
	}

	@Override
	public boolean addBook(int stid, String bookName, int bookKind, Float bookPrice, Float expressPrice,
			String bookAuthor, String bookIntroduction, String bookMainIma) {
		BackMallDao md = new BackMallDaoImpl();
		int row = md.addBook(stid,bookName,bookKind,bookPrice,expressPrice,
				bookAuthor,	bookIntroduction,bookMainIma);
		return row>0 ? true : false;
	}

	@Override
	public boolean delBook(int bookid) {
		BackMallDao md = new BackMallDaoImpl();
		int row = md.delBook(bookid);
		return row>0 ? true : false;
	}

}
